-
Notifications
You must be signed in to change notification settings - Fork 450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: ensure instantiateMVarsProfiling
adds a trace node
#5501
Conversation
This fixes a "time leak" when profiling large proofs, where instantiating the goal meta variable can take a significant amount of time.
instantiateMVarsProfiling
adds a trace node.instantiateMVarsProfiling
adds a trace node
Mathlib CI status (docs):
|
!bench to ensure the code doesn't introduce non trivial regressions. |
I'm also not exactly sure that this is the proper solution for the |
Here are the benchmark results for commit e78addd. Benchmark Metric Change
=======================================================
+ import Lean task-clock -11.4% (-12.9 σ)
+ import Lean wall-clock -11.5% (-12.9 σ)
+ lake config tree task-clock -9.3% (-17.4 σ)
+ lake config tree wall-clock -9.3% (-16.7 σ)
+ language server startup task-clock -1.8% (-13.6 σ)
+ language server startup wall-clock -1.8% (-10.4 σ) |
Fair point. It should be noted that The proper solution would be to add a trace node to |
@hargoniX, since you added thumbs-up to my last comment, does that mean you approve of the change in this PR, or do you think we should do the "proper" solution and rip up |
I do understand why you did what you did now. But I do not have enough knowledge about our meta internals to know what exactly would be required here. Someone else from the team would have to weigh in. |
awaiting-review Probably helps if I put that tag on. I'll be away for the next two/three weeks, though, so I won't respond to any review comments until then |
…#5501) We add a new `Meta.instantiateMVars` trace node to the `instantiateMVarsProfiling` definition used in `elabMutualDef`, and we replace various uses of plain `instantiateMVars` with the profiled version (which necessitated pulling up the definition to be higher in the file). This fixes a "time leak" when profiling large proofs, where instantiating the goal metavariable can take a significant amount of time, that previously would not be accounted for when using the trace profiler.
We add a new
Meta.instantiateMVars
trace node to theinstantiateMVarsProfiling
definition used inelabMutualDef
, and we replace various uses of plaininstantiateMVars
with the profiled version (which necessitated pulling up the definition to be higher in the file).This fixes a "time leak" when profiling large proofs, where instantiating the goal metavariable can take a significant amount of time, that previously would not be accounted for when using the trace profiler.